import request from '@/utils/request'
export const getEmployeeListApi = params => request({
  url: '/sys/user',
  params
})

export const exportEmployeeApi = () => request({
  url: '/sys/user/export',
  responseType: 'blob'
})

export const getExportTemplateApi = () => request({
  url: '/sys/user/import/template',
  responseType: 'blob'
})

export const uploadExcelApi = (data) => request({
  method: 'post',
  url: '/sys/user/import',
  data
})
// 删除员工接口
export const delEmployeeApi = id => request({
  method: 'delete',
  url: `/sys/user/${id}`
})
// 新增员工
export const addEmployeeApi = (data) => request({
  method: 'post',
  url: '/sys/user',
  data
})

// 查看员工详情
export const getEmployeeDetailApi = id => request({
  url: `/sys/user/${id}`
})
// 编辑员工
export const updateEmployeeApi = data => request({
  method: 'put',
  url: `/sys/user/${data.id}`,
  data
})
